package jmine.tec.script.persistent.mock;

import java.io.BufferedReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import jmine.tec.script.persistent.driver.HeaderExtractor;

/**
 * Extrator de cabeçalho de scripts mock
 * 
 * @author lundberg
 */
public class MockHeaderExtractor implements HeaderExtractor {

    /**
     * {@inheritDoc}
     * 
     * @throws IOException IOException
     */
    public List<String> readLines(BufferedReader reader) throws IOException {
        List<String> lines = new ArrayList<String>();
        String line = reader.readLine();
        while (!line.matches(".*[><+-,\\.\\[\\]].*")) {
            lines.add(line);
            line = reader.readLine();
        }
        return lines;
    }

}
